const sequelize = require('sequelize')
const db = require('@/database')


const order = db.define('aa_movie', {
    id: {
        type: sequelize.INTEGER,
        primaryKey: true,//主键
        autoIncrement: true,//自动增长
        allowNull: false,//不允许为空
        field: 'id',
        comment: '主键ID'
    },
    category_id: {
        type: sequelize.INTEGER(),
        allowNull: false,
        field: 'category_id',
        comment: '类型id'
    },
    title: {
        type: sequelize.STRING(),
        allowNull: false,
        field: 'title',
        comment: '标题'
    },
    imgUrl: {
        type: sequelize.TEXT(),
        allowNull: false,
        field: 'imgUrl',
        comment: '图片地址'
    },
    actor: {
        type: sequelize.STRING(),
        allowNull: false,
        field: 'actor',
        comment: '演员'
    },
    director: {
        type: sequelize.STRING(),
        allowNull: false,
        field: 'director',
        comment: '导演'
    },
    is_delete: {
        type: sequelize.BOOLEAN(),
        field: 'is_delete',
        comment: '是否删除',
        defaultValue: false,
        allowNull: false
    },
    sales: {
        type: sequelize.INTEGER(),
        field: 'sales',
        comment: '销量',
        defaultValue: 0,
        allowNull: false
    },
}, { timestamps: true, updatedAt: false });
//抛出模型
module.exports = order